import java.util.Scanner; // 需要导入 util 包
import java.util.Random;
/**
 * @Author YuanYuan
 * @Date 2022/4/24
 * @Time 21:14
 */
public class TestDemo {
    public static void main(String[] args) {
        Random random = new Random();
        // 默认随机种子是系统时间
        Scanner sc = new Scanner(System.in);
        int toGuess = random.nextInt(100);
        while (true) {
            System.out.println("请输入要输入的数字: (1-100)");
            int num = sc.nextInt();
            if (num < toGuess) {
                System.out.println("低了");
            } else if (num > toGuess) {
                System.out.println("高了");
            } else {
                System.out.println("猜对了");
                break;
            }
        }
        sc.close();
    }
    public static void main18(String[] args) {
        Scanner sc = new Scanner(System.in);
        int sum = 0;
        int num = 0;
        while (sc.hasNextInt()) {
            int tmp = sc.nextInt();
            sum += tmp; num++;
        }
        System.out.println("sum = " + sum);
        System.out.println("avg = " + sum / num);
        sc.close();
    }
    public static void main17(String[] args) {

        Scanner sc = new Scanner(System.in);
        System.out.println("请输入你的姓名：");
        String name = sc.nextLine();
        System.out.println("请输入你的年龄：");
        int age = sc.nextInt();
        System.out.println("请输入你的工资：");
        float salary = sc.nextFloat();
        System.out.println("你的信息如下：");
        System.out.println("姓名: "+name+"\n"+"年龄："+age+"\n"+"工资："+salary);
        sc.close();
        // 注意, 要记得调用关闭方法
    }
    public static void main16(String[] args) {
        System.out.println("hello world");
        int x = 10;
        System.out.printf("x = %d\n", x);
    }
    public static void main15(String[] args) {
        int num = 1;
        do {
            System.out.println(num);
            num++;
        } while (num <= 10);
    }
    public static void main14(String[] args) {
        int sum = 0;
        for (int i = 1; i <= 5; i++) {
            int tmp = 1;
            for (int j = 1; j <= i; j++) {
                tmp *= j;
            }
            sum += tmp;
        }
        System.out.println("sum = " + sum);
    }
    public static void main13(String[] args) {
        int result = 1;
        for (int i = 1; i <= 5; i++) {
            result *= i;
        }
        System.out.println("result = " + result);
    }
    public static void main12(String[] args) {
        int sum = 0;
        for (int i = 1; i <= 100; i++) {
            sum += i;
        }
        System.out.println("sum = " + sum);
        // 执行结果 5050
    }
    public static void main11(String[] args) {
        for (int i = 1; i <= 10; i++) {
            System.out.println(i);
        }
    }
    public static void main10(String[] args) {
        int num = 100;
        while (num <= 200) {
            if (num % 3 != 0) {
                num++; // 这里的 ++ 不要忘记! 否则会死循环.
                continue;
            }
            System.out.println("找到了 3 的倍数, 为:" + num); num++;
        }
    }
    public static void main9(String[] args) {
        int num = 100;
        while (num <= 200) {
            if (num % 3 == 0) {
                System.out.println("找到了 3 的倍数, 为:" + num);
                break;
            }
            num++;
        }
    }
    public static void main8(String[] args) {
        int day = 1;
        switch(day) {
            case 1:
                System.out.println("星期一");
            case 2:
                System.out.println("星期二");
        }
    }

    public static void main7(String[] args) {
        int day = 6;
        switch(day) {
            case 1: System.out.println("星期一");
                break;
            case 2: System.out.println("星期二");
                break;
            case 3: System.out.println("星期三");
                break;
            case 4: System.out.println("星期四");
                break;
            case 5: System.out.println("星期五");
                break;
            case 6: System.out.println("星期六");
                break;
            case 7: System.out.println("星期日");
                break;
            default: System.out.println("输入有误");
                break;
        }
    }
    public static void main6(String[] args) {
        int x = 20;
        if (x == 10); {
            System.out.println("hehe");
        }
    }
    public static void main5(String[] args) {
        int score = 59;
        if(score >= 90){
            System.out.println("优秀");
        }else if(score >= 80 && score < 90){
            System.out.println("良好");
        }else if(score >= 70 && score < 80){
            System.out.println("中等");
        }else if(score >= 60 && score < 70){
            System.out.println("及格");
        }else if(score >= 0 && score < 60){
            System.out.println("不及格");
        }else{
            System.out.println("错误数据");
        }

    }
    public static void main4(String[] args) {
        int score = 89;
        if(score >= 90){
            System.out.println("吃个大鸡腿!!!");
        }else{
            System.out.println("挨大嘴巴子!!!");
        }
    }
    public static void main3(String[] args) {
        int score = 92;
        if(score >= 90){
            System.out.println("吃个大鸡腿!!!");
        }
    }
    public static void main2(String[] args) {
        System.out.println("aaa");
        System.out.println("ccc");
        System.out.println("bbb");
    }
    public static void main1(String[] args) {
        System.out.println("aaa");
        System.out.println("bbb");
        System.out.println("ccc");

    }
}
